package com.sancorseguros.nova.selenium.pageobject;

import org.openqa.selenium.WebDriver;

import com.sancorseguros.nova.selenium.config.StaticSelenium;

public class LossDetailPage extends AbstractPage {
	
	private static final long serialVersionUID = -7335390716063039345L;

	private WebDriver driver;
	
    public LossDetailPage(WebDriver driver) throws InterruptedException {  
        super();  
        this.setDriver(driver);
        this.setTitle(StaticSelenium.TITLE_LOSS_DETAIL);
	}
    
	public void selectTab(WebDriver driver) throws InterruptedException {
		Thread.sleep(3000);
//		assertTrue(this.getDriver().findElement(By.id("lossInfo")).getText().contains(StaticSelenium.TITLE_LOSS_DETAIL));
		this.isTextPresent(driver, StaticSelenium.LOSS_NUMBER);
	}

	@Override
	public void validatePage() {
		assertTrue(StaticSelenium.INVALID_TEXT, this.isTextPresent(this.getDriver(), StaticSelenium.TITLE_LOSS_DETAIL));
	}
	
	public WebDriver getDriver() {
		return driver;
	}
	
	public void setDriver(WebDriver driver) {
		this.driver = driver;
	}
	
	
}
